<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"> 
<h:head>
	<script src="/resources/js/jquery-2.1.1.min.js"></script>
	<title>Quiz Game - Prenda</title>
</h:head> 
<body>
<ui:composition template="../templates/templatesemheader.xhtml">
	 	<ui:define name="content">
		    <div class="container">			  
					<div class="row">
						<div class="col-md-12">
							<div class="home text-center">
								<h1>Listar Prenda</h1>
								<h:form id="prendaForm" styleClass="form-horizontal">
									  <a4j:region>
									<div class="form-group" >
										<rich:dataTable  id="table" value="#{prendaController.prendas}" var="prenda" 
										styleClass="table table-striped" headerClass="info"  border="1" height="400px" width="700px" >
											 <f:facet name="header">
                        						<rich:columnGroup>
                        							<rich:column>
														 <h:outputText value="ID"/>
													</rich:column>
													<rich:column>
														 <h:outputText value="Descrição"/>
													</rich:column>
													<rich:column>
														 <h:outputText value="Ação"/>
													</rich:column>
                        						</rich:columnGroup>
                        					</f:facet>
												<rich:column>
													 <h:outputText value="#{prenda.id}"/>
												</rich:column>
												<rich:column>
													 <h:outputText value="#{prenda.descricao}"/>
												</rich:column>
												<rich:column style="width:20%">
													 <h:commandLink action="#{prendaController.excluir(prenda)}" value="Excluir" styleClass="btn btn-primary"  />
													  &nbsp;
													 <h:commandLink action="#{prendaController.editar(prenda)}" value="Editar" styleClass="btn btn-primary"  >
													 	<f:param name="idPrenda" value="#{prenda.id}" />
													 </h:commandLink>
												</rich:column>
										</rich:dataTable >
									</div>
										<h:commandLink action="/prenda/cadastrar.jsf" style="margin-right: 15px;" styleClass="btn btn-primary"  value="Nova Prenda" />
									  </a4j:region>
								</h:form>
							</div>
						</div>
					</div>
				</div>
			</ui:define>
		</ui:composition>
</body>
</html>
